package com.meeting.controller.employee;

import com.meeting.dto.LoginDTO;
import com.meeting.dto.RegisterDTO;
import com.meeting.entity.Emp;
import com.meeting.vo.Result;
import com.meeting.service.EmpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/emp")
@Tag(name = "员工登录注册接口")
@Slf4j
public class EmpLoginController {
    @Autowired
    private EmpService empService;

    @PostMapping("/login")
    @Operation(summary = "员工登录")
    public Result login(@RequestBody LoginDTO loginDTO){
        log.info("员工登录请求：{}",loginDTO);
        return empService.login(loginDTO);
    }

    @PostMapping("/register")
    @Operation(summary = "员工注册")
    public Result register(@RequestBody RegisterDTO registerDTO){
        log.info("员工注册请求：{}",registerDTO);
        return empService.register(registerDTO);
    }

    // 验证手机号是否合理


}